/*
 * uart.h
 *
 * UART driver.
 *
 * Copyright (C) 2018 Sinh Micro, Inc.
 * Subject to the GNU Public License, version 2.
 *
 * Author: lipeng<lp@sinhmicro.com>
 * 
 * Encoding format: GB2312
 * Version: v1.2.2
 * Date: 2024-11-05
 */

#ifndef __UART_H__
#define __UART_H__

#include "types.h"

#if (CONFIG_USING_UART0 == 1)
void uart0_init(void);
void uart0_exit(void);

void uart0_suspend(void);
void uart0_resume(void);

void uart0_putc(uint8_t ch);
bool uart0_is_sending(void);

void uart0_turn_rx_on(void);
void uart0_turn_rx_off(void);
int16_t uart0_getc(void);
#else
#define uart0_init()
#define uart0_exit()
#define uart0_suspend()
#define uart0_resume()
#define uart0_putc(c)
#define uart0_is_sending() (false)
#define uart0_getc() (-1)
#endif

#endif
